package org.example.exampreparationtreasure.common;

public class QuestionsResponse{
    private int code;
    private String message;
    private Object data;
    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static QuestionsResponse success(Object data){
        QuestionsResponse response = new QuestionsResponse();
        response.setCode(CommonResultStatus.OK.getCode());
        response.setMessage(CommonResultStatus.OK.getMessage());
        response.setData(data);
        return response;
    }
    public static QuestionsResponse fail(int code,String message){
        QuestionsResponse response = new QuestionsResponse();
        response.setCode(code);
        response.setMessage(message);
        return response;
    }


}
